package com.asset.dispoal.business.repayment.service;

import com.asset.dispoal.business.casedispose.dto.CaseDisposePageResponse;
import com.asset.dispoal.business.repayment.api.RepaymentService;
import com.asset.dispoal.business.repayment.dto.RepaymentInfoResponse;
import com.asset.dispoal.business.repayment.dto.RepaymentRequest;
import com.asset.dispoal.business.repayment.service.command.GetPenaltyInterestByFormularCommand;
import com.asset.dispoal.business.repayment.service.command.GetRepaymentInfoBycaseIdCommand;
import com.asset.dispoal.business.repayment.service.command.QueryRepaymentListCommand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tech.mhuang.pacebox.springboot.protocol.Result;
import tech.mhuang.pacebox.springboot.protocol.data.PageVO;

/**
 * @description:
 * @author: yf
 * @date: 2022-09-26 14:45:26
 */
@Service
public class RepaymentServiceImpl implements RepaymentService {

    @Autowired
    private QueryRepaymentListCommand queryRepaymentListCommand;

    @Autowired
    private GetRepaymentInfoBycaseIdCommand getRepaymentInfoBycaseIdCommand;

    @Autowired
    private GetPenaltyInterestByFormularCommand getPenaltyInterestByFormularCommand;

    @Override
    public Result<PageVO<CaseDisposePageResponse>> queryPage(RepaymentRequest request) {
        return queryRepaymentListCommand.execute(request);
    }

    @Override
    public Result<RepaymentInfoResponse> getRepayInfoByCaseId(String caseId) {
        return getRepaymentInfoBycaseIdCommand.execute(caseId);
    }

    @Override
    public Result getPenaltyInterestByFormular(String caseId, String batchParameterId) {
        return getPenaltyInterestByFormularCommand.execute(caseId, batchParameterId);
    }
}
